/******************************************************************************
  XYXKC_CAR.H
  xiaoyingxing line patrol car extension file
  Creation Date: 10-25-2023
  @ XYXKC

  Here, you can use it to control the travel and inspection of the line inspection car

  Distributed as-is; no warranty is given.
******************************************************************************/
#ifndef XYXKC_CAR_H
#define XYXKC_CAR_H
#include "Arduino.h"
#include "YFLineFollow.h"
class XYXKC_CAR
{
public:
    XYXKC_CAR();
    YFLINEFOLLOW yfLS;
    void motor_init(uint8_t *leftMotor, uint8_t *rightMotor);
    void motorRun(bool about, bool direction, int speed);
    void trolleyForward(int speed);
    void trolleyBackward(int speed);
    void carTurningLeft(int speed);
    void carTurningRight(int speed);
    void stopOfPatrolCar();
    void patrolToTheIntersectionAndStop(int speed,float proportion1,float proportion2);
    void patrolToTheLeftIntersectionAndStop(int speed,float proportion1,float proportion2);
    void patrolToTheRightIntersectionAndStop(int speed,float proportion1,float proportion2);
    void stopWhenPatrollingToWireless(int speed,float proportion1,float proportion2);
    void patrolToCenterOffline(int speed,float proportion1,float proportion2);
    void linePatrolTimeStop(int speed,float proportion1,float proportion2,unsigned int time);
    void turnLeftToTheLine(int speed,uint8_t number);
    void turnRightToTheLine(int speed,uint8_t number);
    uint8_t M1[2] = {P16,P8};
    uint8_t M2[2] = {P14,P13};
    uint8_t M3[2] = {P15,P9};
    uint8_t M4[2] = {P1,P0};
    bool Left = false;
    bool Right =true;
    bool back = false;
    bool just = true;

private:
    uint8_t *_leftMotor;
    uint8_t *_rightMotor;
    void _PatrolLine(int speed,float proportion1,float proportion2);
};
 
#endif   